﻿#Region "Using Directives"
Imports System
Imports System.Collections.Generic
Imports System.Text
#End Region

Namespace C4F.DevKit.Bluetooth
    Namespace ServiceAndDeviceDiscovery

        ''' <summary>
        ''' Represents the WsaProtocolInfo structure.
        ''' </summary>
        <System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices. _
                                                     LayoutKind.Sequential, _
                                                     CharSet:=System.Runtime. _
                                                     InteropServices.CharSet.Unicode)> _
        Public Class WsaProtocolInfo

            ''' <summary>
            ''' Bitmask describing the services provided by the protocol.
            ''' </summary>
            Public ServiceFlags1 As UInteger

            ''' <summary>
            ''' Reserved for additional protocol-attribute definitions.
            ''' </summary>
            Public ServiceFlags2 As UInteger

            ''' <summary>
            ''' Reserved for additional protocol-attribute definitions.
            ''' </summary>
            Public ServiceFlags3 As UInteger

            ''' <summary>
            ''' Reserved for additional protocol-attribute definitions.
            ''' </summary>
            Public ServiceFlags4 As UInteger

            ''' <summary>
            ''' Provides information about how this protocol is represented
            ''' in the protocol catalog. 
            ''' </summary>
            Public ProviderFlags As UInteger

            ''' <summary>
            ''' Globally unique identifier assigned to the provider by the 
            ''' service provider vendor. 
            ''' </summary>
            Public ProviderId As Guid

            ''' <summary>
            ''' Unique identifier assigned by the WS2_32.DLL for each 
            ''' WSAPROTOCOL_INFO structure.
            ''' </summary>
            Public CatalogEntryId As UInteger

            ''' <summary>
            ''' WSAPROTOCOLCHAIN structure associated with the protocol.
            ''' </summary>
            Public ProtocolChain As WsaProtocolChain

            ''' <summary>
            ''' Protocol version identifier.
            ''' </summary>
            Public Version As Integer

            ''' <summary>
            ''' Value to pass as the address family parameter to the 
            ''' socket/WSASocket function in order to open a socket for this 
            ''' protocol. 
            ''' </summary>
            Public AddressFamily As Integer

            ''' <summary>
            ''' Maximum address length, in bytes.
            ''' </summary>
            Public MaxSockAddr As Integer

            ''' <summary>
            ''' Minimum address length, in bytes.
            ''' </summary>
            Public MinSockAddr As Integer

            ''' <summary>
            ''' Value to pass as the socket type parameter to the socket
            ''' function in order to open a socket for this protocol.
            ''' </summary>
            Public SocketType As Integer

            ''' <summary>
            ''' Value to pass as the protocol parameter to the socket
            ''' function in order to open a socket for this protocol.
            ''' </summary>
            Public Protocol As Integer

            ''' <summary>
            ''' Maximum value that may be added to iProtocol when 
            ''' supplying a value for the protocol parameter to socket 
            ''' and WSASocket.
            ''' </summary>
            Public ProtocolMaxOffset As Integer

            ''' <summary>
            ''' Currently these values are manifest constants 
            ''' (BIGENDIAN and LITTLEENDIAN) that indicate either big-endian 
            ''' or little-endian with the values 0 and 1 respectively.
            ''' </summary>
            Public NetworkByteOrder As Integer

            ''' <summary>
            ''' Indicates the type of security scheme employed (if any).
            ''' </summary>
            Public SecuritySchema As Integer

            ''' <summary>
            ''' Maximum message size supported by the protocol.
            ''' </summary>
            Public MessageSize As Integer

            ''' <summary>
            ''' Reserved for use by service providers.
            ''' </summary>
            Public ProviderReserved As Integer

            ''' <summary>
            ''' Array of characters that contains a human-readable name 
            ''' identifying the protocol.
            ''' </summary>
            <System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices. _
                                                      UnmanagedType.ByValTStr, _
                                                      SizeConst:=BluetoothHelper. _
                                                      WSAPROTOCOL_LEN + 1)> _
            Public ProtocolName As String

        End Class

    End Namespace

End Namespace